Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseVaultTest refactoring #1196

Merged
merged 6 commits into from
Jan 3, 2025
Merged

BaseVaultTest refactoring #1196

merged 6 commits into from
Jan 3, 2025

Conversation

elshan-eth
Copy link
Contributor

Description

This PR makes variables that are used as constants actually constant and also adds some hooks for more flexible lifecycle customization.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Dependency changes
  • Code refactor / cleanup
  • Optimization: [ ] gas / [ ] bytecode
  • Documentation or wording changes
  • Other

Checklist:

  • The diff is legible and has no extraneous changes
  • Complex code has been commented, including external interfaces
  • Tests have 100% code coverage
  • The base branch is either main, or there's a description of how to merge

Issue Resolution

Copy link
Collaborator

@EndymionJkb EndymionJkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such a big diff I might have missed something, but looks good. Could perhaps have done the lifecycle stuff separately as a small PR, but I guess it's fine

@@ -75,19 +75,19 @@ contract BigPoolDataTest is BaseVaultTest {
vm.stopPrank();
}

function _approveForSender() internal {
function _approveNewPoolForSender() internal {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several similar functions here that are identical except for the target of the loop. Consider factoring it out into BaseVaultTest (maybe with an argument for the array). For instance, BigWeightedPool.t.sol's _approvePoolTokensForSender / _approvePoolTokensForPool; and here _approveNewPoolForSender / _approveForNewPool

pkg/vault/test/foundry/utils/BaseVaultTest.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@jubeira jubeira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@joaobrunoah joaobrunoah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@EndymionJkb EndymionJkb self-assigned this Dec 30, 2024
@jubeira jubeira merged commit b74a012 into main Jan 3, 2025
13 checks passed
@jubeira jubeira deleted the base-vault-test-refactoring branch January 3, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants